home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: howland.reston.ans.net!torn!news!apollo!saed
- From: saed@engn.uwindsor.ca (Saed Aryan,13325,1100,g)
- Subject: Dynamic Casting / RTTI
- X-Nntp-Posting-Host: apollo.engn.uwindsor.ca
- Message-ID: <DoJF68.Mx8@news.uwindsor.ca>
- Keywords: dynamic casting, rtti
- Sender: news@news.uwindsor.ca (Usenet)
- Reply-To: saed@engn.uwindsor.ca
- Organization: VLSI Research Group - University of Windsor
- Date: Tue, 19 Mar 1996 23:13:20 GMT
-
-
- Hi All,
-
- given the following code:
-
- class Base{};
- class Deri : public Base{};
- main(){ Base * pB = new Deri; };
-
- --- How do can I obtain a 'Deri' class pointer to the same object as pB?
-
- sort of like: Deri * pD = dynamic_cast<Deri*>(pB);
- but this yields an error:
- cannot dynamic_cast `pB' (of type `class Base *') to type `class Deri *'
-
- Lots of thanks in advance,
-
- Aryan saed@engn.uwindsor.ca
-
-
-
-